package com.shopping.shoppingdemo.config;

/**
 * @author Yandel
 * @date 2025/10/21 18:58
 * @description:数据源上下文持有者
 */
public class DataSourceContextHolder {
    private static final ThreadLocal<String> CONTEXT = new ThreadLocal<>();

    public static void set(String dataSourceType) {
        CONTEXT.set(dataSourceType);
    }

    public static String get() {
        return CONTEXT.get();
    }

    public static void clear() {
        CONTEXT.remove();
    }
}